package demo

import org.apache.spark.{SparkConf, SparkContext}

object test02 {

  private val conf: SparkConf = new SparkConf().setAppName("testMapValue").setMaster("local[*]")

  def main(args: Array[String]): Unit = {

    val context = new SparkContext(conf)

    val data = context.parallelize(List(("zhangsan", 1), ("zhangsan", 1), ("lisi", 1)))

    val value = data.mapValues {
      _ + 1
    }
    value.foreach(println)

    context.stop()
  }

}
